package demo1;

public class LeetCode11 {
    public int maxArea(int[] height) {
        int ret = 0;
        int left = 0, right = height.length - 1;
        while(left < right) {
            int tmp = Math.min(height[left],height[right]) * (right - left);
            ret = Math.max(ret,tmp);
            if(height[left] < height[right]) left++;
            else right--;
        }
        return ret;
    }
}
